#include <stdio.h>
#include <string.h>

#define MAX 100 // 标识符常量
#define STR "abcdefg"
#define MAX_(X,Y) (X<Y?Y:X) //宏 

void size_of_type(){
	printf("char %zu\n",sizeof(char));
	printf("short %zu\n",sizeof(short));
	printf("int %zu\n",sizeof(int));
	printf("long %zu\n",sizeof(long));
	printf("long long %zu\n",sizeof(long long));
	printf("float %zu\n",sizeof(float));
	printf("double %zu\n",sizeof(double));
};

void test_add(){
	int num1 = 0;
	int num2 = 0;
	int sum = 0;
	scanf("%d %d",&num1,&num2);
	sum = num1 + num2;
	printf("%d",sum);
}

void test_static(){
	static int a = 1; // 修饰局部变量，在出代码块不销毁 
	a++;
	printf("%d\n",a);
}

void test_const(){
	const int n = 10;
	int arr[n] = {1};
}

void test_define(){
    printf("%d\n",MAX);
    printf("%s\n",STR);
}

enum Color {
    RED,
    GREEN,
    BLUE,
};

void test_enum(){
    enum Color r = RED;
	enum Color g = GREEN;
    printf("%d\n",r);
    printf("%d\n",g);
}

void test_arr(){
	int arr[10];
	for (int i =0 ; i<10 ;i++) {
		arr[i] = i;
	}
	printf("%d",arr[9]);
}

void test_string(){
	char arr1[] = "abcdef";  // 可以自动
	char arr2[] = {'a','b','c','d','e','f'}; //不含 \0
	char arr3[] = {'a','b','c','d','e','f','\0'};
	printf("%s %d\n",arr1,strlen(arr1));
	printf("%s %d\n",arr2,strlen(arr2));
	printf("%s %d\n",arr3,strlen(arr3));

	printf("%c\n","\130"); // \130 = 8*8 + 3*8 = 88 -> X
	printf("%c\n","\x30"); // \x30 = 3*16 = 48 -> 0
	printf("\a");
}

void test_pointer(){
	int age = 12;
	int *address = &age;
	*address = 24;
	printf("%p\n",&age);
	printf("%u\n",*address);
}

void test_opt(){
	int a = 1;
	int b = 2;
	int c = 3;
	int d = (a=a+b, c=b+c,a+c); // 8
	printf("%d",d);
}

extern int ADD(int,int); 

extern int global_value; 

struct Book // 结构体 
{
	int bid;
	char name[10];
};

struct Stu {
    // 成员
    char name[20];
    int age;
    char sex[10];
};
void test_struct() {
	struct Stu s1 = {"zhang",21,"nan"};
	struct Stu* ps = &s1;
	printf("%s %d %s\n",s1.name,s1.age,s1.sex);
	printf("%s %d %s\n",(*ps).name,(*ps).age,(*ps).sex);
	printf("%s %d %s\n",ps->name,ps->age,ps->sex);
}

void past(){
	int a = ~0;
	int* p = &a; //地址指针 
	signed int b = 1; // 等价于 int  
	unsigned int c = 1; 
	typedef unsigned int u_int; // typedef 类型重定义 
	u_int d = 2;
	register int e = 1; // register 寄存器变量 
	extern int g_value;//声明外部符号 
	struct Book book1 = {114514,"testbook"};
	struct Book* book1_pd = &book1; 
	printf("a = %d\n",a);
	printf("b = %d\n",b);
	printf("c = %d\n",c);
	printf("d = %d\n",d);
	printf("e = %d\n",e); 
	printf("global_value = %d\n",global_value);
	c = ADD(a,b);
	printf("extern add = %d\n",c);
	printf("MAX = %d\n",MAX);
	printf("MAX_ = %d\n",MAX_(c,global_value));
	printf("address a = %p\n",p); 
	*p = 2; // 解引用操作符 
	printf("a = %d\n",a);
	printf("size of addrese = %d\n",sizeof(p)); 
	printf("book id = %d\n",book1.bid);
	printf("book id = %d\n",(*book1_pd).bid);
	printf("book id = %d\n",book1_pd->bid);
};

extern int lower();

int test_getchar(){
    int ch = 0;
    while ((ch = getchar()) != EOF) {
        putchar(ch);
    }
    return 0;
}

#include <windows.h>
#include <string.h>

void test_goto_shutdown(){
	char input[20] = {0};
again:
	system("shutdown -s -t 60");
	scanf("%s",input);
	if (strcmp(input,"not") == 0){
		system("shutdown -a");
	} else {
		goto again;
	}
	printf("see you again");
}

void Swap(int* px, int* py){
	int z = *px;
	*px = *py;
	*py = z;
}

void test_Swap(){
	int a = 10;
	int b = 20;
	printf("a=%d,b=%d\n",a,b);
	Swap(&a,&b);
	printf("a=%d,b=%d\n",a,b);
}

int binary_search(int arr[], int key, int size_of_arr) {
	// 函数内部无法计算组数大小，arr 本质是指针，sizeof得到指针大小
	int left = 0;
	int right = size_of_arr-1;
	int mid = 0;
	while (left <= right) {
		mid = (left + right)/2;
		if (arr[mid] > key) {
			right = mid -1;
		} else if (arr[mid] < key) {
			left = mid + 1;
		} else {
			return mid;
		}
	}
	return -1;
}

void test_binary_search() {
	int arr[] = {1,2,3,4,5,6,8,9,10};
	int key = 6;
	int size = sizeof(arr)/sizeof(arr[0]);
	int index = binary_search(arr, key, size);
	printf("%d",index);
}

void get_each_num(int num)
{
	if (num > 0)
	{
		get_each_num(num/10);
	}
	printf("%u ",num%10);
}

void test_get_each_num()
{
	unsigned int num = 0;
	scanf("%u", &num);
	get_each_num(num);
}

#include <stdlib.h>
int main()
{
	// size_of_type();
	// test_add();
	// printf("%d",global_value);
	// test_const();
	// test_define();
	// test_enum();
	// test_arr();
	// test_pointer();
	// test_string();
	// lower();
	// test_getchar();
	// test_goto_shutdown();
	// test_Swap();
	// test_binary_search();
	// test_get_each_num();
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	if (a+b>c || a+c>b || b+c>a)
	{
		printf("Not triangle");
	}
	else if (a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a)
	{
		printf("Right triangle");
	}
	else if (a*a+b*b>c*c || a*a+c*c>b*b || b*b+c*c>a*a)
	{
		printf("Acute triangle");
	}
	else
	{
		printf("Obtuse triangle");
	}
	if (a==b || a==c || b==c)
	{
		printf("Isosceles triangle");
		if (a==b && a==c)
		{
			printf("Equilateral triangle");
		}
	}
    return 0;
}

//void test()
//{
//	printf("test\n");
//}
//
//enum Name
//{
//	Tom,
//	Lisa,
//	Luxi
//}; 
//
//int main()
//{
//	int a = 1;
//	int b = (a == 2) ? 2 : 3;
//	int i = 1; 
//	const Name name = Tom;
//	printf("%d\n",name);
//	test();
//	printf("%d\n",b);
//	a = 3;
//	switch (a)
//	{
//		case 1:
//			printf("1\n");
//			break;
//		case 2:
//			printf("2\n");
//			break;
//		default:
//			printf("other\n");
//	}
//	while (i<10){
//		printf("%d\n",i);
//		i+=1;
//	}
//	do {
//		printf("%d\n",i);
//		i-=1;
//	}
//	while (i>0);
//	printf("test for loop\n");
//	for (i=0 ; i<10 ; i++) {
//		printf("%d\n",i);
//	}
//	
//	return 0;
//}
